package com.ugoodtech.mdcc.web.pojo.vo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
public class PerformancePlanData {

	/**
	 * 品牌定位
	 */
	private Integer brandOrientation;

	/**
	 * 年份
	 */
	private Integer year;

	/**
	 * 状态
	 */
	private Integer status;

	/**
	 * 品牌定位
	 */
	private String brandOrientationStr;

	/**
	 * 状态
	 */
	private String statusStr;

	private Integer version;

	/**
	 * 项目 0 = 集采, 1 = 非集采, 2 = 销售额总计, 3 = 达成率, 4 = 达成差额, 5 = 与往年相比
	 */
	private Integer project;

	private String projectStr;

	private Map<Integer, BigDecimal> monthMap = new HashMap<>(12);

	/**
	 * 月份数据
	 */
	private List<BigDecimal> monthData = new ArrayList<>(12);

	/**
	 * 月份是否修改过标记
	 */
	private List<MonthData> monthModificationData = new ArrayList<>(12);
	/**
	 * 季度是否修改过标记
	 */
	private List<MonthData> seasonModificationData = new ArrayList<>(4);
	/**
	 * 年度是否修改过标记
	 */
	private MonthData yearModificationData;
	private Map<Integer, MonthData> monthModificationDataMap = new HashMap<>(12);
	/**
	 * 全年合计
	 */
	private BigDecimal annualStatisticsData;

	/**
	 * 季度数据
	 */
	private List<BigDecimal> seasonStatisticsData = new ArrayList<>(4);

	private List<BigDecimal> collectionData = new ArrayList<>(17);

	@Data
	@AllArgsConstructor
	@NoArgsConstructor
	public static class TypeData{

		/**
		 * 品牌定位
		 */
		private Integer brandOrientation;
		/**
		 * 年份
		 */
		private Integer year;

		/**
		 * 状态
		 */
		private Integer status;

		/**
		 * 项目 0 = 集采, 1 = 非集采, 2 = 销售额总计, 3 = 达成率, 4 = 达成差额, 5 = 与往年相比
		 */
		private Integer project;

		@Override
		public boolean equals(Object o) {
			if (this == o) {
				return true;
			}
			if (o == null || getClass() != o.getClass()) {
				return false;
			}
			TypeData typeData = (TypeData) o;
			return Objects.equals(brandOrientation, typeData.brandOrientation) &&
					Objects.equals(year, typeData.year) &&
					Objects.equals(status, typeData.status) &&
					Objects.equals(project, typeData.project);
		}

		@Override
		public int hashCode() {
			return Objects.hash(brandOrientation, year, status, project);
		}
	}

	@Data
	@AllArgsConstructor
	@NoArgsConstructor
	public static class MonthData{

		private Integer month;
		private BigDecimal sales;
		private Integer isModified;

	}

}
